﻿@using VirtualPress.Infrastructure.Entities.Entity;
@{
    ViewBag.Title = "Secret";
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
<div id="content-header">
    <h1>
        修改密码</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/home/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> 
    <a class="current">修改密码</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-pencil"></i></span>
                    <h5>
                        修改密码</h5>
                    <h5 style="float: right; color: Red;">
                        *为必填</h5>
                </div>
                <div class="widget-content nopadding">
                    @{
                        var user = new User().Find(HttpContext.Current.User.Identity.Name);
                    }
                    <form id="pwdform" class="form-horizontal" action="/workspace/home/secret" method="post">
                    @if (!String.IsNullOrEmpty(ViewBag.Message))
                    {
                        <div class="control-group" style="padding: 10px;">
                            <div class="alert alert-success">
                                <button class="close" data-dismiss="alert">
                                    ×</button>
                                @ViewBag.Message
                            </div>
                        </div>
                    }
                    <div class="control-group">
                        <label class="control-label">
                            原密码 (*)
                        </label>
                        <div class="controls">
                            <input type="password" name="oldpwd" class="{required:true}" placeholder="请输入原密码" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            新密码 (*)
                        </label>
                        <div class="controls">
                            <input type="password" name="newpwd" id="txtnewpwd" class="{required:true}" placeholder="请输入新使用的密码" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            确认密码 (*)
                        </label>
                        <div class="controls">
                            <input type="password" name="confirm" class="{required:true,equalTo:'#txtnewpwd'}"
                                placeholder="再次输入" />
                        </div>
                    </div>
                    <div class="form-actions">
                        <input id="next" class="btn btn-primary" type="submit" value="保存" />
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail
{
    <script type="text/javascript" src="/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/scripts/unicorn.wizard.js"></script>
    <script type="text/javascript" src="/scripts/jquery.metadata.js"></script>
    <script type="text/javascript" src="/scripts/jquery.wizard.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likSelf').addClass('open active');
            $('#pwdform').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
        });
    </script>
}
